package patterns.interpreter;


/**
 * Created by lenovo on 2016/11/30 0030.
 * AND逻辑的解释器
 */
public class AndExpression implements IExpression{
    private IExpression exp1 = null;
    private IExpression exp2 = null;

    public AndExpression(IExpression exp1, IExpression exp2){
        this.exp1 = exp1;
        this.exp2 = exp2;
    }
    
    @Override
    public boolean interpret(String context) {
        return exp1.interpret(context) && exp2.interpret(context);
    }
}
